import request from '../utils/request';

export async function getAddressList() {
  return request('/wyApi/api/delivery-address');
}

export async function deleteAddress(id) {
  return request(`/wyApi/api/delivery-address/${id}`, {method: 'DELETE'})
}

export async function setDefaultAddress(id) {
  return request(`/wyApi/api/delivery-address/${id}/default`, {method: 'POST'})
}

export async function addAddress(payload) {
  return request('/wyApi/api/delivery-address', {method: 'POST', body: payload});
}

export async function editAddress(payload) {
  return request(`/wyApi/api/delivery-address/${payload.id}`, {method: 'POST', body: payload});
}

